<template>
    <div style="overflow-x: hidden; width: 100%">
        <!--        分割线-->
        <hr style="border: 1px dashed darkgray;transform: scaleY(0.5); margin-top: -1px;">
        <div v-if="queryDetail===0">
        <el-tabs type="border-card" :active-name="activeName" @tab-click="handlClick" style="position: absolute; width: 99%;">
            <el-row v-if="active===0">
                <el-col :span="3">
                    <el-input v-model="caseLawSearch.searchData" clearable></el-input>
                </el-col>
                <el-col :span="3">
                    <el-select v-model="caseLawSearch.select" filterable placeholder="请选择">
                        <el-option label="委托人搜索" value="1"></el-option>
                        <el-option label="对方当事人搜索" value="2"></el-option>
                        <el-option label="案号搜索" value="3"></el-option>
                        <el-option label="案由搜索" value="4"></el-option>
                        <el-option label="归档号搜索" value="5"></el-option>
                        <el-option label="受理机关搜索" value="6"></el-option>
                        <el-option label="受理法院搜索" value="7"></el-option>
                    </el-select>
                </el-col>
                <el-col :span="3">
                    <el-select v-model="caseLawSearch.caseApproveStatus" clearable>
                        <el-option label="审批中" value="1"></el-option>
                        <el-option label="审批通过" value="2"></el-option>
                        <el-option label="审批不通过" value="3"></el-option>
                    </el-select>
                </el-col>
                <el-col :span="3">
                    <el-select v-model="caseLawSearch.caseCaseTypeId" filterable placeholder="请选择" clearable>
                        <span v-for="(item,index) in caseTypeData" :key="index">
                            <el-option :value="item.id+''" :label="item.caseTypeName"></el-option>
                        </span>
                    </el-select>
                </el-col>
                <el-col :span="3">
                    <el-select v-model="caseLawSearch.caseSettleStatus" clearable>
                        <el-option label="已结案" value="Y"></el-option>
                        <el-option label="未结案" value="N"></el-option>
                    </el-select>
                </el-col>
                <el-col :span="3">
                    <el-select v-model="caseLawSearch.sortMode">
                        <el-option label="自定义排序" value="1"></el-option>
                        <el-option label="编号倒序" value="2"></el-option>
                        <el-option label="登记时间正序" value="3"></el-option>
                        <el-option label="登记时间倒序" value="4"></el-option>
                        <el-option label="收案时间正序" value="5"></el-option>
                        <el-option label="收案时间倒序" value="6"></el-option>
                    </el-select>
                </el-col>
                <el-col :span="1" :offset=1>
                    <el-button type="primary" @click="seniorSearch">检索</el-button>
                </el-col>
            </el-row>
                <el-tab-pane label="我的个人案件" name="first">
                    <div v-if="active===0">
                    <el-table
                            :data="caseData"
                            border
                            style="width: 100%;margin-top: 10px;margin-bottom: 10px"
                            :cell-style="cellStyle">
                        <el-table-column
                                align="center"
                                prop="caseNo"
                                label="案号"
                                width="149">
                            <template slot-scope="scope">
                                <a href="javascript:" @click="queryDetails(scope.row.id)">
                                    {{scope.row.caseNo}}
                                </a>
                            </template>
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseWtr"
                                label="委托人">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseOppositeParties"
                                label="对方当事人"
                                width="103">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseAttorney"
                                label="承办律师">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseSettleStatus"
                                label="结案状态"
                                :formatter="caseSettleStatusFormatter"
                                width="100">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseAgencyfee"
                                label="代理费(元)"
                                width="103">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="casePaidsal"
                                label="已付款(元)"
                                width="103">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseInvoiced"
                                label="已开票(元)"
                                width="103">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseApproveStatus"
                                label="审批状态"
                                :formatter="caseApproveStatusFormatter"
                                width="105">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseContract"
                                label="合同"
                                :formatter="caseContractFilenumberFormatter"
                                width="60px">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                prop="caseRecord"
                                label="档案"
                                :formatter="caseContractFilenumberFormatter"
                                width="60px">
                        </el-table-column>
                        <el-table-column
                                align="center"
                                label="操作"
                                width="105">
                            <template slot-scope="scope">
                                <el-dropdown trigger="click">
                                    <el-button type="primary" @click="handleClick(scope.row.id)">
                                        操作<i class="el-icon-arrow-down el-icon--right"></i>
                                    </el-button>
                                    <el-dropdown-menu slot="dropdown">
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="standard(scope.row.standard,scope.row.clientId)">费用减免申请</el-dropdown-item>
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="casePaidsal(scope.row.caseUnpaidsal)">添加收款记录</el-dropdown-item>
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="cwInvoice">申请发票</el-dropdown-item>
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseContract(scope.row.caseContract)">{{scope.row.caseContract==="1"?'合同归档':'取消合同归档'}}</el-dropdown-item>
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseRecord(scope.row.caseRecord)">{{scope.row.caseRecord==="1"?'档案归档':'取消档案归档'}}</el-dropdown-item>
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="caseShare(scope.row.caseShare)">{{scope.row.caseShare==="2"?'共享':'取消共享'}}</el-dropdown-item>
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseSettle(scope.row.caseSettleStatus,scope.row.caseUnpaidsal)">结案</el-dropdown-item>
                                        <el-dropdown-item v-if="scope.row.caseApproveStatus==='3'" @click.native="caseAgain">重新立案</el-dropdown-item>
                                    </el-dropdown-menu>
                                </el-dropdown>
                            </template>
                        </el-table-column>
                    </el-table>
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="1"
                            :page-sizes="[1, 5, 10, 20, 50, 100]"
                            :page-size="pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="total">
                    </el-pagination>
                    </div>
            <div v-if="active===1" style="margin-top: 30px">
                    <CaseReduction :caseId="caseId" @changeActive="changeActive"></CaseReduction>
                </div>
            <div v-if="active===2">
                    <CasePaidsal :caseId="caseId" :caseUnpaidsal="caseUnpaidsal" @changeActive="changeActive"></CasePaidsal>
                </div>
            </el-tab-pane>
            <el-tab-pane label="我的合办案件">
                <div v-if="active===0">
                <el-table
                        :data="caseData"
                        border
                        style="width: 100%;margin-top: 10px;margin-bottom: 10px"
                        :cell-style="cellStyle">
                    <el-table-column
                            align="center"
                            prop="caseNo"
                            label="案号"
                            width="149">
                        <template slot-scope="scope">
                            <a href="javascript:" @click="queryDetails(scope.row.id)">
                                {{scope.row.caseNo}}
                            </a>
                        </template>
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseWtr"
                            label="委托人">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseOppositeParties"
                            label="对方当事人"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAttorney"
                            label="承办律师"
                            width="164">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseSettleStatus"
                            label="结案状态"
                            :formatter="caseSettleStatusFormatter"
                            width="100">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAgencyfee"
                            label="代理费(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="casePaidsal"
                            label="已付款(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseInvoiced"
                            label="已开票(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseApproveStatus"
                            label="审批状态"
                            :formatter="caseApproveStatusFormatter"
                            width="105">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseContract"
                            label="合同"
                            :formatter="caseContractFilenumberFormatter"
                            width="60">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseRecord"
                            label="档案"
                            :formatter="caseContractFilenumberFormatter"
                            width="60">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            label="操作"
                            width="105">
                        <template slot-scope="scope">
                            <el-dropdown trigger="click">
                                <el-button type="primary" @click="handleClick(scope.row.id)" class="role_btn" :id="scope.row.hrEmpId">
                                    操作<i class="el-icon-arrow-down el-icon--right"></i>
                                </el-button>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="standard(scope.row.standard,scope.row.clientId)">费用减免申请</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="casePaidsal(scope.row.caseUnpaidsal)">添加收款记录</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="cwInvoice">申请发票</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseContract(scope.row.caseContract)">{{scope.row.caseContract==="1"?'合同归档':'取消合同归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseRecord(scope.row.caseRecord)">{{scope.row.caseRecord==="1"?'档案归档':'取消档案归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="caseShare(scope.row.caseShare)">{{scope.row.caseShare==="2"?'共享':'取消共享'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseSettle(scope.row.caseSettleStatus,scope.row.caseUnpaidsal)">结案</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='3'" @click.native="caseAgain">重新立案</el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[1, 5, 10, 20, 50, 100]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total">
                </el-pagination>
                </div>
                <div v-if="active===1" style="margin-top: 30px">
                    <CaseReduction :caseId="caseId" @changeActive="changeActive"></CaseReduction>
                </div>
                <div v-if="active===2">
                    <CasePaidsal :caseId="caseId" :caseUnpaidsal="caseUnpaidsal" @changeActive="changeActive"></CasePaidsal>
                </div>
            </el-tab-pane>
            <el-tab-pane label="共享案件">
                <div v-if="active===0">
                <el-table
                        :data="caseData"
                        border
                        style="width: 100%;margin-top: 10px;margin-bottom: 10px"
                        :cell-style="cellStyle">
                    <el-table-column
                            align="center"
                            prop="caseNo"
                            label="案号"
                            width="149">
                        <template slot-scope="scope">
                            <a href="javascript:" @click="queryDetails(scope.row.id)">
                                {{scope.row.caseNo}}
                            </a>
                        </template>
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseWtr"
                            label="委托人">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseOppositeParties"
                            label="对方当事人"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAttorney"
                            label="承办律师">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseSettleStatus"
                            label="结案状态"
                            :formatter="caseSettleStatusFormatter"
                            width="100">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAgencyfee"
                            label="代理费(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="casePaidsal"
                            label="已付款(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseInvoiced"
                            label="已开票(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseApproveStatus"
                            label="审批状态"
                            :formatter="caseApproveStatusFormatter"
                            width="105">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseContract"
                            label="合同"
                            :formatter="caseContractFilenumberFormatter"
                            width="60">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseRecord"
                            label="档案"
                            :formatter="caseContractFilenumberFormatter"
                            width="60">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            label="操作"
                            width="105">
                        <template slot-scope="scope">
                            <el-dropdown trigger="click">
                                <el-button type="primary" @click="handleClick(scope.row.id)" class="share_btn" :id="scope.row.hrEmpId">
                                    操作<i class="el-icon-arrow-down el-icon--right"></i>
                                </el-button>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="standard(scope.row.standard,scope.row.clientId)">费用减免申请</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="casePaidsal(scope.row.caseUnpaidsal)">添加收款记录</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="cwInvoice">申请发票</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseContract(scope.row.caseContract)">{{scope.row.caseContract==="1"?'合同归档':'取消合同归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseRecord(scope.row.caseRecord)">{{scope.row.caseRecord==="1"?'档案归档':'取消档案归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="caseShare(scope.row.caseShare)">{{scope.row.caseShare==="2"?'共享':'取消共享'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseSettle(scope.row.caseSettleStatus,scope.row.caseUnpaidsal)">结案</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='3'" @click.native="caseAgain">重新立案</el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[1, 5, 10, 20, 50, 100]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total">
                </el-pagination>
                </div>
                <div v-if="active===1" style="margin-top: 30px">
                    <CaseReduction :caseId="caseId" @changeActive="changeActive"></CaseReduction>
                </div>
                <div v-if="active===2">
                    <CasePaidsal :caseId="caseId" :caseUnpaidsal="caseUnpaidsal" @changeActive="changeActive"></CasePaidsal>
                </div>
            </el-tab-pane>
            <el-tab-pane label="我的待收款案件" name="fourth">
                <div v-if="active===0">
                <el-table
                        :data="caseData"
                        border
                        style="width: 100%;margin-top: 10px;margin-bottom: 10px"
                        :cell-style="cellStyle">
                    <el-table-column
                            align="center"
                            prop="caseNo"
                            label="案号"
                            width="149">
                        <template slot-scope="scope">
                            <a href="javascript:" @click="queryDetails(scope.row.id)">
                                {{scope.row.caseNo}}
                            </a>
                        </template>
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseWtr"
                            label="委托人">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseOppositeParties"
                            label="对方当事人"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAttorney"
                            label="承办律师">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAgencyfee"
                            label="代理费(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="casePaidsal"
                            label="已付款(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseUnpaidsal"
                            label="未付金额"
                            width="100">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseInvoiced"
                            label="已开票(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseApproveStatus"
                            label="审批状态"
                            :formatter="caseApproveStatusFormatter"
                            width="105">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            label="操作"
                            width="105">
                        <template slot-scope="scope">
                            <el-dropdown trigger="click">
                                <el-button type="primary" @click="handleClick(scope.row.id)">
                                    操作<i class="el-icon-arrow-down el-icon--right"></i>
                                </el-button>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="standard(scope.row.standard,scope.row.clientId)">费用减免申请</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="casePaidsal(scope.row.caseUnpaidsal)">添加收款记录</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="cwInvoice">申请发票</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseContract(scope.row.caseContract)">{{scope.row.caseContract==="1"?'合同归档':'取消合同归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseRecord(scope.row.caseRecord)">{{scope.row.caseRecord==="1"?'档案归档':'取消档案归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="caseShare(scope.row.caseShare)">{{scope.row.caseShare==="2"?'共享':'取消共享'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseSettle(scope.row.caseSettleStatus,scope.row.caseUnpaidsal)">结案</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='3'" @click.native="caseAgain">重新立案</el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[1, 5, 10, 20, 50, 100]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total">
                </el-pagination>
                </div>
                <div v-if="active===1" style="margin-top: 30px">
                    <CaseReduction :caseId="caseId" @changeActive="changeActive"></CaseReduction>
                </div>
                <div v-if="active===2">
                    <CasePaidsal :caseId="caseId" :caseUnpaidsal="caseUnpaidsal" @changeActive="changeActive"></CasePaidsal>
                </div>
            </el-tab-pane>
            <el-tab-pane label="我的案件汇总">
                <div v-if="active===0">
                <el-table
                        :data="caseData"
                        border
                        style="width: 100%;margin-top: 10px;margin-bottom: 10px"
                        :cell-style="cellStyle">
                    <el-table-column
                            align="center"
                            prop="caseNo"
                            label="案号"
                            width="149">
                        <template slot-scope="scope">
                            <a href="javascript:" @click="queryDetails(scope.row.id)">
                                {{scope.row.caseNo}}
                            </a>
                        </template>
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseWtr"
                            label="委托人">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseOppositeParties"
                            label="对方当事人"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAttorney"
                            label="承办律师">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseSettleStatus"
                            label="结案状态"
                            :formatter="caseSettleStatusFormatter"
                            width="100">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseAgencyfee"
                            label="代理费(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="casePaidsal"
                            label="已付款(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseInvoiced"
                            label="已开票(元)"
                            width="103">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseApproveStatus"
                            label="审批状态"
                            :formatter="caseApproveStatusFormatter"
                            width="105">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseContract"
                            label="合同"
                            :formatter="caseContractFilenumberFormatter"
                            width="60">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="caseRecord"
                            label="档案"
                            :formatter="caseContractFilenumberFormatter"
                            width="60">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            label="操作"
                            width="105">
                        <template slot-scope="scope">
                            <el-dropdown trigger="click">
                                <el-button type="primary" @click="handleClick(scope.row.id)" class="summary_btn" :id="scope.row.hrEmpId">
                                    操作<i class="el-icon-arrow-down el-icon--right"></i>
                                </el-button>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="standard(scope.row.standard,scope.row.clientId)">费用减免申请</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="casePaidsal(scope.row.caseUnpaidsal)">添加收款记录</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="cwInvoice">申请发票</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseContract(scope.row.caseContract)">{{scope.row.caseContract==="1"?'合同归档':'取消合同归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseRecord(scope.row.caseRecord)">{{scope.row.caseRecord==="1"?'档案归档':'取消档案归档'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus!=='3'" @click.native="caseShare(scope.row.caseShare)">{{scope.row.caseShare==="2"?'共享':'取消共享'}}</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='2'" @click.native="caseSettle(scope.row.caseSettleStatus,scope.row.caseUnpaidsal)">结案</el-dropdown-item>
                                    <el-dropdown-item v-if="scope.row.caseApproveStatus==='3'" @click.native="caseAgain">重新立案</el-dropdown-item>
                                </el-dropdown-menu>
                            </el-dropdown>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="1"
                        :page-sizes="[1, 5, 10, 20, 50, 100]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="total">
                </el-pagination>
                </div>
                <div v-if="active===1" style="margin-top: 30px">
                    <CaseReduction :caseId="caseId" @changeActive="changeActive"></CaseReduction>
                </div>
                <div v-if="active===2">
                    <CasePaidsal :caseId="caseId" :caseUnpaidsal="caseUnpaidsal" @changeActive="changeActive"></CasePaidsal>
                </div>
            </el-tab-pane>
        </el-tabs>
        </div>
        <div v-if="queryDetail===1">
            <CaseDetails :case-id="caseId" @back="back"></CaseDetails>
        </div>
        <div v-if="queryDetail===2">
            <span style="font-size: 25px;margin-left: 50px"><b>基本信息</b></span>
            <hr style="border: 1px dashed darkgray;width: 1360px;transform: scaleY(0.5);margin-bottom: 25px">
            <el-table
                    :data="caseData"
                    border
                    style="width: 92%;margin-left: 60px;margin-bottom: 60px">
                <el-table-column
                        prop="caseNo"
                        label="案号"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="caseWtr"
                        label="委托人"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="caseCaseTypeName"
                        label="案件类型"
                        align="center">
                </el-table-column>
                <el-table-column
                        prop="caseCause"
                        label="案由"
                        align="center">
                </el-table-column>
            </el-table>
            <el-form ref="caseSettleForm" :model="caseSettleForm" :rules="rules" label-width="80px" onsubmit="return false">
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="结案方式" prop="caseSettleType">
                            <el-select v-model="caseSettleForm.caseSettleType" placeholder="请选择结案类型" style="width: 100%">
                                <el-option value="1" label="调解"></el-option>
                                <el-option value="2" label="判决"></el-option>
                                <el-option value="3" label="撤诉"></el-option>
                                <el-option value="4" label="其他方式"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="结案时间" prop="caseApprovalEndtime">
                            <el-date-picker type="date" placeholder="选择日期" v-model="caseSettleForm.caseApprovalEndtime" style="width: 100%;"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="21" :offset=1>
                        <el-form-item label="备注">
                            <el-input type="textarea" v-model="caseSettleForm.remark"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="1" :offset=9>
                        <el-button type="info" @click="notcd">返回</el-button>
                    </el-col>
                    <el-col :span="1" :offset=2>
                        <el-button type="primary" @click="formSubmit('caseSettleForm')" style="margin-left: -10px">立即创建</el-button>
                    </el-col>
                </el-row>
            </el-form>
        </div>
<!--        重新立案-->
        <div v-if="queryDetail===3">
            <span style="font-size: 25px;margin-left: 50px"><b>基本信息</b></span>
            <hr style="border: 1px dashed darkgray;width: 1360px;transform: scaleY(0.5);margin-bottom: 25px">
            <el-form :model="caseForm" ref="caseForm" :rules="rules1" label-width="100px" class="demo-caseForm" onsubmit="return false">
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="案号" prop="caseNo">
                            <el-input v-model="caseForm.caseNo" placeholder="请输入案号" readonly></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="案由" prop="caseCause">
                            <el-input v-model="caseForm.caseCause" placeholder="请输入案由" clearable></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="委托人" prop="caseWtr">
                            <el-input v-model="caseForm.caseWtr" placeholder="请输入委托人" readonly></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10"  :offset=1>
                        <el-form-item label="收案日期" prop="collectionTime">
                            <el-date-picker type="date" placeholder="选择收案日期" v-model="caseForm.collectionTime " style="width: 100%;"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="对方当事人" prop="caseOppositeParties">
                            <el-input v-model="caseForm.caseOppositeParties" placeholder="请输入对方当事人"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10"  :offset=1>
                        <el-form-item label="对方证件号" prop="caseOppositeCardnum">
                            <el-input v-model="caseForm.caseOppositeCardnum" placeholder="请输入对方当事人身份证号" readonly></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="受理机关" prop="caseAccept">
                            <el-select v-model="caseForm.caseAccept" placeholder="请选择受理机关" style="width: 100%">
                                <span v-for="(item,index) in caseAccept" :key="index">
                                    <el-option :value="item.id+''" :label="item.acceptName"></el-option>
                                </span>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10"  :offset=1>
                        <el-form-item label="受理法院" prop="caseCourt">
                            <el-select v-model="caseForm.caseCourt" placeholder="请选择受理法院" style="width: 100%">
                                <span v-for="(item,index) in caseCourt" :key="index">
                                    <el-option :value="item.id+''" :label="item.courtName"></el-option>
                                </span>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="收费方式" prop="caseChargeWay">
                            <el-select v-model="caseForm.caseChargeWay" placeholder="请选择收费方式" style="width: 100%">
                                <el-option value="免费">免费</el-option>
                                <el-option value="计件收费">计件收费</el-option>
                                <el-option value="计时收费">计时收费</el-option>
                                <el-option value="按标的额比例收费">按标的额比例收费</el-option>
                                <el-option value="风险代理收费">风险代理收费</el-option>
                                <el-option value="标的+风险收费">标的+风险收费</el-option>
                                <el-option value="固定+风险收费">固定+风险收费</el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10"  :offset=1>
                        <el-form-item label="代理费" prop="caseAgencyfee">
                            <el-input v-model.number="caseForm.caseAgencyfee" placeholder="请输入代理费"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="诉讼标的" prop="caseLawsuitobj">
                            <el-input v-model="caseForm.caseLawsuitobj" placeholder="请输入诉讼标的"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10"  :offset=1>
                        <el-form-item label="风险收费" prop="caseFxmoney">
                            <el-input v-model.number="caseForm.caseFxmoney" placeholder="请输入风险收费"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10" :offset=1>
                        <el-form-item label="政府补助" prop="caseSubsidy">
                            <el-select v-model="caseForm.caseSubsidy" @change="selectChange" placeholder="请选择政府补助" style="width: 100%">
                                <el-option value="N" label="否"></el-option>
                                <el-option value="Y" label="是"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10"  :offset=1>
                        <el-form-item label="补助金额" prop="caseSubsidysal">
                            <el-input v-model.number="caseForm.caseSubsidysal" :readonly="readonly" placeholder="请输入补助金额"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="23" :offset=1>
                        <el-form-item label="诉讼阶段" prop="caseStatus">
                            <el-radio-group v-model="caseForm.caseStatus" style="margin-top: 11px;">
                                <el-radio label="立案">立案</el-radio>
                                <el-radio label="一审">一审</el-radio>
                                <el-radio label="二审">二审</el-radio>
                                <el-radio label="执行">执行</el-radio>
                                <el-radio label="再审">再审</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="23" :offset=1>
                        <el-form-item label="诉讼地位" prop="caseLawsuitStatus">
                            <el-radio-group v-model="caseForm.caseLawsuitStatus" style="margin-top: 11px;">
                                <el-radio label="原告">原告</el-radio>
                                <el-radio label="被告">被告</el-radio>
                                <el-radio label="上诉人">上诉人</el-radio>
                                <el-radio label="被上诉人">被上诉人</el-radio>
                                <el-radio label="申请执行人">申请执行人</el-radio>
                                <el-radio label="被申请执行人">被申请执行人</el-radio>
                                <el-radio label="申请人">申请人</el-radio>
                                <el-radio label="被申请人">被申请人</el-radio>
                                <el-radio label="第三人">第三人</el-radio>
                                <el-radio label="其他">其他</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="3"><span style="font-size: 25px;margin-left: 50px"><b>其他选填</b></span></el-col>
                    <el-col :span="1" style="padding-top: 5px">
                        <el-switch v-model="xt"></el-switch>
                    </el-col>
                </el-row>
                <hr style="border: 1px dashed darkgray;width: 1360px;transform: scaleY(0.5);margin-bottom: 25px">
                <div v-if="xt">
                    <el-row>
                        <el-col :span="10" :offset=1>
                            <el-form-item label="专属案号" prop="casePropernum">
                                <el-input v-model="caseForm.casePropernum" placeholder="请输入专属案号"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10"  :offset=1>
                            <el-form-item label="杂费" prop="caseProxysal">
                                <el-input v-model="caseForm.caseProxysal" placeholder="请输入杂费"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10" :offset=1>
                            <el-form-item label="办案地区" prop="caseTransactionRegion">
                                <el-cascader
                                        ref="cascaderAddr"
                                        size="large"
                                        :options="options"
                                        v-model="this.caseForm.caseTransactionRegion"
                                        placeholder="请选择地区"
                                        style="width: 100%">
                                </el-cascader>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10" :offset=1>
                            <el-form-item label="是否指派" prop="caseAssign">
                                <el-select v-model="caseForm.caseAssign" placeholder="请选择是否指派" style="width: 100%">
                                    <el-option value="N">否</el-option>
                                    <el-option value="Y">是</el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="10" :offset=1>
                            <el-form-item label="第三人" prop="caseThirdParty">
                                <el-input v-model="caseForm.caseThirdParty" placeholder="请输入第三人"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="10" :offset=1>
                            <el-form-item label="相关文件" prop="caseCorrelationFile">
                                <el-button type="primary" @click="fileUp">上传文件<i class="el-icon-upload el-icon--right"></i></el-button>
                                <el-upload
                                        class="upload-demo"
                                        ref="upload"
                                        action=""
                                        :limit="1"
                                        :http-request="submitUpload"
                                        :before-upload="beforeUpload"
                                        :on-exceed="onExceed"
                                        v-show="false">
                                    <el-button ref="xzwj">选取文件</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="21" :offset=1>
                            <el-form-item label="备注" prop="caseRemarks">
                                <el-input type="textarea" v-model="caseForm.caseRemarks"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
            </el-form>
            <span style="font-size: 25px;margin-left: 50px"><b>办案律师</b></span>
            <hr style="border: 1px dashed darkgray;width: 1360px;transform: scaleY(0.5);margin-bottom: 25px">
            <el-form :model="cwForm" ref="cwForm" :rules="rules2" label-width="100px" class="demo-cwForm" onsubmit="return false">
                <el-row>
                    <el-col :span="5">
                        <el-form-item prop="caseAttorney">
                            <el-input v-model="cwForm.caseAttorney" readonly></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" style="margin-left: -99px">
                        <el-form-item prop="zhuBanLvShi">
                            <el-input v-model="cwForm.zhuBanLvShi" readonly></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset=1>
                        <el-form-item label="业绩分成" prop="cwPerformancesplit">
                            <el-input v-model.number="cwForm.cwPerformancesplit" placeholder="请输入业绩分成"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" style="margin-left: -99px">
                        <el-form-item prop="cwSplitType">
                            <el-select v-model="cwForm.cwSplitType" style="width: 200px">
                                <el-option value="百分比">百分比</el-option>
                                <el-option value="固定金额">固定金额</el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="3" :offset=1>
                        <el-button @click="addRows" type="primary">增加一行</el-button>
                    </el-col>
                </el-row>
                <el-row v-for="(item,index) in cwForm.rows" :key="index">
                    <el-col :span="5">
                        <el-form-item :rules="rules2.caseAttorney" :prop="'rows.'+index+'.caseAttorney'">
                            <el-select v-model="item.caseAttorney" style="width: 205px">
                                <el-option value="督办律师">督办律师</el-option>
                                <el-option value="协助律师">协助律师</el-option>
                                <el-option value="实习律师">实习律师</el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" style="margin-left: -99px">
                        <el-form-item :rules="rules2.zhuBanLvShi" :prop="'rows.'+index+'.zhuBanLvShi'">
                            <el-input v-model="item.zhuBanLvShi" readonly="readonly" placeholder="点击选择律师" @click.native="choiceLawyersDialog(index)"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset=1>
                        <el-form-item label="业绩分成" :rules="rules2.cwPerformancesplit" :prop="'rows.'+index+'.cwPerformancesplit'">
                            <el-input v-model.number="item.cwPerformancesplit" placeholder="请输入业绩分成"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="5" style="margin-left: -99px">
                        <el-form-item :rules="rules2.cwSplitType" :prop="'rows.'+index+'.cwSplitType'">
                            <el-select v-model="item.cwSplitType" style="width: 200px">
                                <el-option value="百分比">百分比</el-option>
                                <el-option value="固定金额">固定金额</el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="3" :offset=1>
                        <el-button @click="reRows(index)" type="danger">删除</el-button>
                    </el-col>
                </el-row>
                <el-form-item>
                    <el-row>
                        <el-col :span="1" :offset=6>
                            <el-button type="info" @click="notcd">返回</el-button>
                        </el-col>
                        <el-col :span="1" :offset=2>
                            <el-button type="primary" @click="formSubmit('caseForm')">立即创建</el-button>
                        </el-col>
                        <el-col :span="1" :offset=2>
                            <el-button @click="resetForm('caseForm')">重置</el-button>
                        </el-col>
                    </el-row>
                </el-form-item>
            </el-form>
            <el-dialog
                    title="请选择办案律师"
                    :visible.sync="getLawyersList"
                    width="50%">
                <!--                    :before-close="handleClose"-->
                <span>
                    <el-table
                            @row-click="rowClick"
                            :data="LawyersList"
                            border
                            style="width: 100%">
                        <el-table-column
                                prop="id"
                                label="编号"
                                width="180">
                        </el-table-column>
                        <el-table-column
                                prop="empName"
                                label="姓名"
                                width="180">
                        </el-table-column>
                        <el-table-column
                                prop="empSex"
                                label="性别"
                                :formatter="sexFormatter">
                        </el-table-column>
                        <el-table-column
                                prop="empPosition"
                                label="职务">
                        </el-table-column>
                        <el-table-column
                                prop="empPhone"
                                label="电话">
                        </el-table-column>
                    </el-table>
                </span>
                <span slot="footer" class="dialog-footer">
<!--                    <el-button @click="getLawyersList = false">取 消</el-button>-->
                    <el-button type="primary" @click="getLawyersList = false">取 消</el-button>
                </span>
            </el-dialog>
        </div>
        <div v-if="queryDetail===4">
            <AddCaseAgency :case-id="caseId" @back="back"></AddCaseAgency>
        </div>
    </div>
</template>

<script>
    import AddCaseService from "../../model/AddCaseService";
    import CaseReduction from "./CaseReduction";
    import CasePaidsal from "./CasePaidsal";
    import CaseDetails from "./CaseDetails";
    import AddCaseAgency from "./AddCaseAgency";
    import $ from 'jquery'

    const addCaseService =AddCaseService.getInstance();
    export default {
        name: "MyCase",
        components:{
            CaseReduction,
            CasePaidsal,
            CaseDetails,
            AddCaseAgency
        },
        data(){
            return{
                caseTypeData:[],//案件类型下拉框
                caseData:[],//案件表格数据
                caseId:"",//存储操作数据的主键
                caseUnpaidsal:"",//剩余未付金额
                tabIndex:"0",//存储当前标签页码
                active:0,//显示与隐藏
                queryDetail:0,//查看案件详情
                lawyers:[],//办案律师数据
                sealApplyfor:[],//用印申请数据
                getLawyersList:false,//查询律师列表对话框
                LawyersList:[],//办案律师列表
                caseAccept:[],//受理机关
                caseCourt:[],//受理法院
                readonly:false,//是否只读
                xt:false,//switch 滑块
                files:'',//文件
                fileName:'',//文件名
                zhuBanLvShiIndex:"",//主办律师下标
                activeName:"first",//激活页面

                total:"",//数据总条数
                pageSize:5,//每页显示条数
                pageNum:1,//当前页

                ops: {//滚动条
                    vuescroll: {},
                    scrollPanel: {},
                    rail: {},
                    bar: {}
                },
                caseLawSearch:{
                    searchData:"",//搜索框数据
                    select:"",//下拉框选项
                    caseApproveStatus:"",//审批状态
                    caseCaseTypeId:"",//案件类型
                    caseSettleStatus:"",//结案状态
                    sortMode:"1",//排序方法
                },
                caseSettleForm:{
                    id:"",//案件id
                    caseSettleType:"",//结案方式
                    caseApprovalEndtime:null,//结案时间
                    remark:"",//备注
                },
                rules:{
                    caseSettleType:[
                        {required:true,message:"请选择结案方式!",trigger:"blur"}
                    ],
                    caseApprovalEndtime:[
                        {required:true,message:"请选择结案日期!",trigger:"blur"}
                    ]
                },
                caseForm:{//案件表单
                    id:"",//案件id
                    clientId:"",//客户id
                    caseLawId:"",//案号id
                    caseNo:"",//案号
                    caseCause:"",//案由
                    caseWtr:"",//委托人
                    collectionTime:"",//收案日期
                    caseOppositeParties:"",//对方当事人
                    caseOppositeCardnum:"",//对方当事人身份证号
                    caseAccept:"",//受理机关
                    caseCourt:"",//受理法院
                    caseChargeWay:"",//收费方式
                    caseAgencyfee:"",//代理费
                    caseLawsuitobj:"",//诉讼标的
                    caseFxmoney:"",//风险收费
                    caseSubsidy:"",//政府补助
                    caseSubsidysal:"",//补助金额
                    caseStatus:"",//诉讼阶段
                    caseUnpaidsal:"",//未付金额
                    caseLawsuitStatus:"",//诉讼地位
                    casePropernum:"",//专属案号
                    caseProxysal:"0",//杂费
                    caseTransactionRegion:[],//办案地区
                    caseAssign:null,//是否指派
                    caseThirdParty:"",//第三人
                    caseCorrelationFile:"",//相关文件
                    caseRemarks:"",//备注
                    caseCaseTypeId:"",//案件类型id
                    caseApproveStatus:"1",
                },
                rules1:{//案件表单验证规则
                    caseNo:[
                        {required:true,message:"请输入案号!",trigger:"blur"}
                    ],
                    caseCause:[
                        {required:true,message:"请输入案由!",trigger:"blur"}
                    ],
                    caseWtr:[
                        {required:true,message:"请输入委托人!",trigger:"blur"}
                    ],
                    collectionTime:[
                        {required:true,message:"请选择收案日期!",trigger:"blur"}
                    ],
                    caseOppositeParties:[
                        {required:true,message:"请输入对方当事人!",trigger:"blur"}
                    ],
                    caseOppositeCardnum:[
                        {required:true,message:"请输入对方当事人证件号!",trigger:"blur"}
                    ],
                    caseAccept:[
                        {required:true,message:"请选择受理机关!",trigger:"blur"}
                    ],
                    caseCourt:[
                        {required:true,message:"请选择受理法院!",trigger:"blur"}
                    ],
                    caseChargeWay:[
                        {required:true,message:"请选择收费方式!",trigger:"blur"}
                    ],
                    caseAgencyfee:[
                        {required:true,message:"请输入代理费!",trigger:"blur"},
                        {type:"number",message: "请正确输入代理费!(数字类型)"}
                    ],
                    caseLawsuitobj:[
                        {required:true,message:"请输入诉讼标的!",trigger:"blur"}
                    ],
                    caseFxmoney:[
                        {required:true,message:"请输入风险收费!",trigger:"blur"},
                        {type:"number",message: "请正确输入风险收费!(数字类型)"}
                    ],
                    caseSubsidy:[
                        {required:true,message:"请选择政府补助!",trigger:"blur"}
                    ],
                    caseSubsidysal:[
                        {required:true,message:"请输入补助金额!",trigger:"blur"},
                        {type:"number",message: "请正确输入补助金额!(数字类型)"}
                    ],
                    caseStatus:[
                        {required:true,message:"至少选择一项!",trigger:"blur"}
                    ],
                    caseLawsuitStatus:[
                        {required:true,message:"至少选择一项!",trigger:"blur"}
                    ],
                    caseProxysal:[
                        {pattern:"^[0-9]*$",message:"请正确输入杂费!(数字类型)",trigger:"blur"}
                    ],
                },
                cwForm:{//办案律师分成表单
                    caseAttorney:"主办律师",//主办律师
                    hrEmpId:"",//主办律师id
                    zhuBanLvShi:"",//主办律师
                    cwPerformancesplit:"",//百分比
                    cwSplitType:"",//模式
                    rows:[],//添加一行
                },
                rules2:{//办案律师分成表单验证规则
                    caseAttorney:[
                        {required:true,message:"请选择律师类型!",trigger:"blur"}
                    ],
                    zhuBanLvShi:[
                        {required:true,message:"请选择律师!",trigger:"blur"}
                    ],
                    cwPerformancesplit:[
                        {type:"number",required:true,message:"业绩分成应为数字类型!",trigger:"blur"}
                    ],
                    cwSplitType:[
                        {required:true,message:"请选择分成模式!",trigger:"blur"}
                    ]
                },
            }
        },
        created() {
            this.queryCaseType();
            this.queryCase(null);
            if(this.$route.params.activeName==="fourth"){
                this.activeName="fourth"
            }
        },
        methods:{
            cwInvoice(){//申请开票
                this.$router.push({name:"cwinvoice",params:{id:this.caseId}})
            },
            selectChange(val){//政府补助改变事件
                if(val==="N"){
                    this.readonly=true;
                    this.caseForm.caseSubsidysal=0
                }else{
                    this.readonly=false
                }
            },
            caseAgain(){//重新立案
                this.$loading({//懒加载
                    lock: true,
                    text: '正在查询...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                const param={
                    id:this.caseId
                };
                addCaseService.querySenior(this.$http,param).then(msg=>{
                    const data=msg.data.data.list[0];
                    if(data.caseCaseTypeId.substring(0,4)==="1011"){
                        this.queryDetail=4
                    }else{
                        this.caseForm.clientId=data.clientId;//客户id
                        this.caseForm.caseNo=data.caseNo;//案号
                        this.caseForm.caseCause=data.caseCause;//案由
                        this.caseForm.caseWtr=data.caseWtr;//委托人
                        this.caseForm.collectionTime=this.$set(this.caseForm,'collectionTime',data.collectionTime);//收案日期
                        this.caseForm.caseOppositeParties=data.caseOppositeParties;//对方当事人
                        this.caseForm.caseOppositeCardnum=data.caseOppositeCardnum;//对方当事人身份证号
                        this.caseForm.caseAccept=data.caseAccept;//受理机关
                        this.caseForm.caseCourt=data.caseCourt;//受理法院
                        this.caseForm.caseChargeWay=data.caseChargeWay;//收费方式
                        this.caseForm.caseAgencyfee=data.caseAgencyfee;//代理费
                        this.caseForm.caseLawsuitobj=data.caseLawsuitobj;//诉讼标的
                        this.caseForm.caseFxmoney=data.caseFxmoney;//风险收费
                        this.caseForm.caseSubsidy=data.caseSubsidy;//政府补助
                        this.caseForm.caseSubsidysal=data.caseSubsidysal;//补助金额
                        this.caseForm.caseStatus=data.caseStatus;//诉讼阶段
                        this.caseForm.caseUnpaidsal=data.caseUnpaidsal;//未付金额
                        this.caseForm.caseLawsuitStatus=data.caseLawsuitStatus;//诉讼地位
                        this.caseForm.casePropernum=data.casePropernum;//专属案号
                        this.caseForm.caseProxysal=data.caseProxysal;//杂费
                        this.caseForm.caseTransactionRegion=data.caseTransactionRegion.split(",");//办案地区
                        this.caseForm.caseAssign=data.caseAssign;//是否指派
                        this.caseForm.caseThirdParty=data.caseThirdParty;//第三人
                        this.caseForm.caseRemarks=data.caseRemarks;//备注
                        this.caseForm.caseCaseTypeId=data.caseCaseTypeId;//案件id
                        this.cwForm.zhuBanLvShi=JSON.parse(localStorage["user"])[0].userRealname;
                        this.queryDetail=3;
                        if(this.caseAccept.length===0||this.caseCourt.length===0){
                            addCaseService.queryCaseAccept(this.$http).then(msg=>{//受理机关
                                this.caseAccept=msg.data.data
                            });
                            addCaseService.queryCaseCourt(this.$http).then(msg=>{//受理法院
                                this.caseCourt=msg.data.data
                            });
                        }
                    }
                    this.$loading().close()
                });
            },
            sexFormatter(row, column, cellValue){//性别转换
                if(cellValue==="M"){
                    return "男"
                }else{
                    return "女"
                }
            },
            rowClick(row){//办案律师表格点击事件//, column, event
                this.cwForm.rows[this.zhuBanLvShiIndex].hrEmpId=row.id;
                this.cwForm.rows[this.zhuBanLvShiIndex].zhuBanLvShi=row.empName;
                this.getLawyersList=false;
            },
            choiceLawyersDialog(index){//选择办案律师对话框
                if(this.LawyersList.length===0){
                    addCaseService.queryHrEmp(this.$http).then(msg=>{
                        this.LawyersList=msg.data.data;
                    });
                }
                this.zhuBanLvShiIndex=index;
                this.getLawyersList=true;
            },
            reRows(index){//删除一行
                this.cwForm.rows.splice(index, 1)
            },
            addRows(){//添加一行
                const rows={
                    caseAttorney:"",//律师
                    caseLawId:"",//案件id
                    hrEmpId:"",//律师id
                    zhuBanLvShi:"",//律师
                    cwPerformancesplit:"",//业绩分成
                    cwSplitType:"",//分成模式
                };
                this.cwForm.rows.push(rows)
            },
            formSubmit(formName) {//提交表单
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        if(formName==="caseSettleForm"){
                            this.caseSettleForm.caseApprovalEndtime=this.$date.formatDate(this.caseSettleForm.caseApprovalEndtime,"yyyy-MM-DD");
                            const param=new URLSearchParams();
                            param.append("id",this.caseId);
                            param.append("caseSettleStatus","Y");
                            param.append("caseSettleType",this.caseSettleForm.caseSettleType);
                            param.append("caseApprovalEndtime",this.caseSettleForm.caseApprovalEndtime);
                            param.append("casePlan","C");
                            addCaseService.upCaseLaw(this.$http,param).then(msg=>{
                                if(msg.data.status==="50000"){
                                    this.$message({
                                        type:"error",
                                        message:"出错了呢~"
                                    })
                                }else {
                                    this.$message({
                                        type:"success",
                                        message:"结案成功~"
                                    });
                                    this.queryDetail=0;
                                    if(this.tabIndex==="0"){
                                        this.queryCase(null);
                                    }else if(this.tabIndex==="1"){
                                        this.queryCases(null)
                                    }else if(this.tabIndex==="2"){
                                        this.queryShareCase(null)
                                    }else if(this.tabIndex==="3"){
                                        this.queryPayCase(null)
                                    }else{
                                        this.querySummaryCases(null)
                                    }
                                }
                            })
                        }else{
                            this.$refs.cwForm.validate((valid) => {
                                if (valid) {
                                    this.caseForm.id=this.caseId;
                                    this.caseForm.caseUnpaidsal=parseInt(this.caseForm.caseAgencyfee)+parseInt(this.caseForm.caseProxysal)
                                        +parseInt(this.caseForm.caseFxmoney)-parseInt(this.caseForm.caseSubsidysal);
                                    const date1=new Date(this.caseForm.collectionTime);
                                    this.caseForm.collectionTime=this.$date.formatDate(date1, "yyyy-MM-DD");
                                    this.caseForm.caseTransactionRegion=this.caseForm.caseTransactionRegion.join(",");
                                    let formData = new URLSearchParams();
                                    for(const key in this.caseForm){
                                        if(Object.prototype.hasOwnProperty.call(this.caseForm, key)){
                                            if(this.caseForm[key]!=null){
                                                formData.append(key,this.caseForm[key]);
                                            }
                                        }
                                    }
                                    const date = this.$date.formatDate(new Date(), "yyyy-MM-DD hh:mm:ss");//yyyy-MM-DD hh:mm:ss
                                    formData.append("caseSubtime",date);
                                    formData.append("caseSubmitter",JSON.parse(localStorage["user"])[0].userRealname);
                                    formData.append("hrEmpId",JSON.parse(localStorage["user"])[0].hrEmpId);
                                    addCaseService.upCase(this.$http,formData).then(msg=> {
                                        if (msg.data.status === "50000") {
                                            this.$message({
                                                type: "error",
                                                message: "出错了呢~"
                                            })
                                        } else {
                                            addCaseService.deCwPerformancesplit(this.$http,this.caseId);
                                            const performancesplit = {
                                                caseAttorney: this.cwForm.caseAttorney,//主办律师
                                                caseLawId: this.caseId,//案件id
                                                hrEmpId: JSON.parse(localStorage["user"])[0].hrEmpId,//主办律师id
                                                zhuBanLvShi: this.cwForm.zhuBanLvShi,//主办律师
                                                cwPerformancesplit: this.cwForm.cwPerformancesplit,//业绩分成
                                                cwSplitType: this.cwForm.cwSplitType,//分成模式
                                            };
                                            let rows = [];
                                            rows.push(performancesplit);
                                            for (let i = 0; i < this.cwForm.rows.length; i++) {
                                                this.cwForm.rows[i].caseLawId = this.caseId;
                                                rows.push(this.cwForm.rows[i])
                                            }
                                            addCaseService.addcwPerformancesplit(this.$http, rows).then(msg => {
                                                if (msg.data.status === "50000") {
                                                    this.$message({
                                                        type: "error",
                                                        message: "出错了呢~"
                                                    })
                                                } else {
                                                    addCaseService.upCaseAt(this.$http,this.caseId).then(()=>{
                                                        this.queryDetail=0;
                                                        if(this.tabIndex==="0"){
                                                            this.queryCase(null);
                                                        }else if(this.tabIndex==="1"){
                                                            this.queryCases(null)
                                                        }else if(this.tabIndex==="2"){
                                                            this.queryShareCase(null)
                                                        }else if(this.tabIndex==="3"){
                                                            this.queryPayCase(null)
                                                        }else{
                                                            this.querySummaryCases(null)
                                                        }
                                                    });
                                                    this.$message({
                                                        type: "success",
                                                        message: "立案成功~"
                                                    });
                                                }
                                            });
                                        }
                                    })
                                }
                            });
                        }
                    }
                });
            },
            handleCurrentChange(val){//当前页发生变化
                if(this.tabIndex==="0"){
                    const page={
                        pageNum:val
                    };
                    this.queryCase(page);
                }else if(this.tabIndex==="1"){
                    const page={
                        pageNum:val
                    };
                    this.queryCases(page)
                }else if(this.tabIndex==="2"){
                    const page={
                        pageNum:val
                    };
                    this.queryShareCase(page)
                }else if(this.tabIndex==="3"){
                    const page={
                        pageNum:val
                    };
                    this.queryPayCase(page)
                }else{
                    const page={
                        pageNum:val
                    };
                    this.querySummaryCases(page)
                }
            },
            handleSizeChange(val){//每页数据条数变化
                if(this.tabIndex==="0"){
                    const page={
                        pageSize:val
                    };
                    this.queryCase(page);
                }else if(this.tabIndex==="1"){
                    const page={
                        pageSize:val
                    };
                    this.queryCases(page)
                }else if(this.tabIndex==="2"){
                    const page={
                        pageSize:val
                    };
                    this.queryShareCase(page)
                }else if(this.tabIndex==="3"){
                    const page={
                        pageSize:val
                    };
                    this.queryPayCase(page)
                }else{
                    const page={
                        pageSize:val
                    };
                    this.querySummaryCases(page)
                }
            },
            back(){//返回按钮
                this.queryDetail=0;
                this.queryCase(null)
            },
            queryDetails(id){//查看案件详情
                this.queryDetail=1;
                this.caseId=id
            },
            changeActive(){//子组件回调
                this.active=0;
                if(this.tabIndex==="0"){
                    this.queryCase(null);
                }else if(this.tabIndex==="1"){
                    this.queryCases(null)
                }else if(this.tabIndex==="2"){
                    this.queryShareCase(null)
                }else if(this.tabIndex==="3"){
                    this.queryPayCase(null)
                }else{
                    this.querySummaryCases(null)
                }
            },
            handlClick(tab){//标签页切换
                this.tabIndex=tab.index;
                this.active=0;
                this.pageSize=5;
                if(tab.index==="0"){
                    this.queryCase(null)
                }else if(tab.index==="1"){
                    this.queryCases(null)
                }else if(tab.index==="2"){
                    this.queryShareCase(null)
                }else if(tab.index==="3"){
                    this.queryPayCase(null)
                }else{
                    this.querySummaryCases(null)
                }
            },
            standard(num,id){//费用减免申请
                this.$loading({//懒加载
                    lock: true,
                    text: '正在校验...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                if(num===0){
                    const params={
                        id:id
                    };
                    addCaseService.seniorQuery(this.$http,params).then(msg=>{
                        const data=msg.data.data[0].typeinfo;
                        if(data.indexOf("未成年")!==-1||
                            data.indexOf("残疾")!==-1||
                            data.indexOf("老年")!==-1||
                            data.indexOf("农民")!==-1){
                            this.active=1;
                        }else{
                            this.$message({
                                type:"warning",
                                message:"您暂不符合减免申请标准~"
                            })
                        }
                        this.$loading().close()
                    });
                }else{
                    this.$message({
                        type:"warning",
                        message:"您已申请过减免~"
                    });
                    this.$loading().close()
                }
            },
            casePaidsal(caseUnpaidsal){//添加付款记录
                this.caseUnpaidsal=parseInt(caseUnpaidsal);
                if(this.caseUnpaidsal>0){
                    this.active=2
                }else{
                    this.$message({
                        type:"warning",
                        message:"金额都已付清啦~"
                    })
                }
            },
            notcd(){
                this.queryDetail=0;
                if(this.tabIndex==="0"){
                    this.queryCase(null);
                }else if(this.tabIndex==="1"){
                    this.queryCases(null)
                }else if(this.tabIndex==="2"){
                    this.queryShareCase(null)
                }else if(this.tabIndex==="3"){
                    this.queryPayCase(null)
                }else{
                    this.querySummaryCases(null)
                }
            },
            caseSettle(caseSettleStatus,caseUnpaidsal){//结案
                if(parseInt(caseUnpaidsal)>0){
                    this.$message({
                        type:"warning",
                        message:"暂未完成付款~"
                    })
                }else if(caseSettleStatus==='Y'){
                    this.$message({
                        type:"warning",
                        message:"已结案~"
                    })
                }else{
                    this.queryDetail=2;
                    this.$loading({//懒加载
                        lock: true,
                        text: '正在查询...',
                        spinner: 'fa fa-refresh fa-spin fa-3x',
                        background: 'rgba(0, 0, 0, 0.7)'
                    });
                    this.caseSettleForm.caseApprovalEndtime=new Date();
                    const param={
                        id:this.caseId
                    };
                    addCaseService.querySenior(this.$http,param).then(msg=>{
                        this.caseData=msg.data.data.list;
                        this.$loading().close()
                    })
                }
            },
            caseRecord(caseRecord){//档案归档
                if(caseRecord==="1"){
                    const params=new URLSearchParams();
                    params.append("id",this.caseId);
                    params.append("caseRecord","2");
                    addCaseService.upCaseLaw(this.$http,params).then(msg=>{
                        if(msg.data.status==="50000"){
                            this.$message({
                                type:"error",
                                message:"出错了呢~"
                            })
                        }else{
                            if(this.tabIndex==="0"){
                                this.queryCase(null);
                            }else if(this.tabIndex==="1"){
                                this.queryCases(null)
                            }else if(this.tabIndex==="2"){
                                this.queryShareCase(null)
                            }else if(this.tabIndex==="3"){
                                this.queryPayCase(null)
                            }else{
                                this.querySummaryCases(null)
                            }
                            this.$message({
                                type:"success",
                                message:"归档成功~"
                            })
                        }
                    })
                }else{
                    const params=new URLSearchParams();
                    params.append("id",this.caseId);
                    params.append("caseRecord","1");
                    addCaseService.upCaseLaw(this.$http,params).then(msg=>{
                        if(msg.data.status==="50000"){
                            this.$message({
                                type:"error",
                                message:"出错了呢~"
                            })
                        }else{
                            if(this.tabIndex==="0"){
                                this.queryCase(null);
                            }else if(this.tabIndex==="1"){
                                this.queryCases(null)
                            }else if(this.tabIndex==="2"){
                                this.queryShareCase(null)
                            }else if(this.tabIndex==="3"){
                                this.queryPayCase(null)
                            }else{
                                this.querySummaryCases(null)
                            }
                            this.$message({
                                type:"success",
                                message:"取消归档成功~"
                            })
                        }
                    })
                }
            },
            caseContract(caseContract){//合同归档
                if(caseContract==="1"){
                    const params=new URLSearchParams();
                    params.append("id",this.caseId);
                    params.append("caseContract","2");
                    addCaseService.upCaseLaw(this.$http,params).then(msg=>{
                        if(msg.data.status==="50000"){
                            this.$message({
                                type:"error",
                                message:"出错了呢~"
                            })
                        }else{
                            if(this.tabIndex==="0"){
                                this.queryCase(null);
                            }else if(this.tabIndex==="1"){
                                this.queryCases(null)
                            }else if(this.tabIndex==="2"){
                                this.queryShareCase(null)
                            }else if(this.tabIndex==="3"){
                                this.queryPayCase(null)
                            }else{
                                this.querySummaryCases(null)
                            }
                            this.$message({
                                type:"success",
                                message:"归档成功~"
                            })
                        }
                    })
                }else{
                    const params=new URLSearchParams();
                    params.append("id",this.caseId);
                    params.append("caseContract","1");
                    addCaseService.upCaseLaw(this.$http,params).then(msg=>{
                        if(msg.data.status==="50000"){
                            this.$message({
                                type:"error",
                                message:"出错了呢~"
                            })
                        }else{
                            if(this.tabIndex==="0"){
                                this.queryCase(null);
                            }else if(this.tabIndex==="1"){
                                this.queryCases(null)
                            }else if(this.tabIndex==="2"){
                                this.queryShareCase(null)
                            }else if(this.tabIndex==="3"){
                                this.queryPayCase(null)
                            }else{
                                this.querySummaryCases(null)
                            }
                            this.$message({
                                type:"success",
                                message:"取消归档成功~"
                            })
                        }
                    })
                }
            },
            fileUp(){//文件上传点击事件
                this.$refs.xzwj.$el.click()
            },
            onExceed(){//文件个数超出限制时
                this.$message({
                    type:"warning",
                    message:"本次文件上传已达限制"
                })
            },
            beforeUpload(file){//文件上传之前
                this.files=file;
                this.fileName=file.name;
            },
            submitUpload() {//文件上传提交事件
                if (this.fileName === "") {
                    this.$message.warning('请选择要上传的文件！');
                    return false
                }
                let fileFormData = new FormData();
                fileFormData.append('file', this.files, this.fileName);//file是键，files是值，就是要传的文件，fileName是要传的文件名
                let requestConfig = {
                    headers: {
                        'Content-Type': 'multipart/form-data'
                    },
                };
                addCaseService.fileUp(fileFormData,requestConfig,this.$http).then(msg=>{
                    this.caseForm.caseCorrelationFile=msg.data.data;
                    this.$message({
                        type:"success",
                        message:"上传成功~"
                    })
                })
            },
            resetForm(formName) {//重置表单
                this.$refs[formName].resetFields();
            },
            caseShare(caseShare){//案件共享
                if(caseShare==="1"){
                    const params=new URLSearchParams();
                    params.append("id",this.caseId);
                    params.append("caseShare","2");
                    addCaseService.upCaseLaw(this.$http,params).then(msg=>{
                        if(msg.data.status==="50000"){
                            this.$message({
                                type:"error",
                                message:"出错了呢~"
                            })
                        }else{
                            if(this.tabIndex==="0"){
                                this.queryCase(null);
                            }else if(this.tabIndex==="1"){
                                this.queryCases(null)
                            }else if(this.tabIndex==="2"){
                                this.queryShareCase(null)
                            }else if(this.tabIndex==="3"){
                                this.queryPayCase(null)
                            }else{
                                this.querySummaryCases(null)
                            }
                            this.$message({
                                type:"success",
                                message:"取消共享成功~"
                            })
                        }
                    })
                }else{
                    const params=new URLSearchParams();
                    params.append("id",this.caseId);
                    params.append("caseShare","1");
                    addCaseService.upCaseLaw(this.$http,params).then(msg=>{
                        if(msg.data.status==="50000"){
                            this.$message({
                                type:"error",
                                message:"出错了呢~"
                            })
                        }else{
                            if(this.tabIndex==="0"){
                                this.queryCase(null);
                            }else if(this.tabIndex==="1"){
                                this.queryCases(null)
                            }else if(this.tabIndex==="2"){
                                this.queryShareCase(null)
                            }else if(this.tabIndex==="3"){
                                this.queryPayCase(null)
                            }else{
                                this.querySummaryCases(null)
                            }
                            this.$message({
                                type:"success",
                                message:"共享成功~"
                            })
                        }
                    })
                }
            },
            handleClick(id){//下拉菜单按钮点击事件
                this.caseId=id
            },
            seniorSearch(){//高级检索
                this.$loading({//懒加载
                    lock: true,
                    text: '正在查询...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                this.pageSize=5;
                let hrEmpId="";
                let lawyerNum="";
                let caseShare="";
                let caseUnpaidsal="";
                let caseAttorney="";
                if(this.tabIndex==="0"){
                    hrEmpId=JSON.parse(localStorage["user"])[0].hrEmpId;
                    lawyerNum="1"
                }else if(this.tabIndex==="1"){
                    lawyerNum="2";
                    caseAttorney=JSON.parse(localStorage["user"])[0].userRealname
                }else if(this.tabIndex==="2"){
                    caseShare="1"
                }else if(this.tabIndex==="3"){
                    hrEmpId=JSON.parse(localStorage["user"])[0].hrEmpId;
                    caseUnpaidsal="1"
                }else{
                    caseAttorney=JSON.parse(localStorage["user"])[0].userRealname
                }
                const params={
                    hrEmpId:hrEmpId,
                    lawyerNum:lawyerNum,
                    caseShare:caseShare,
                    caseUnpaidsal:caseUnpaidsal,
                    caseAttorney:caseAttorney,
                    searchData:this.caseLawSearch.searchData,//搜索框数据
                    select:this.caseLawSearch.select,//下拉框选项
                    caseApproveStatus:this.caseLawSearch.caseApproveStatus,//审批状态
                    caseCaseTypeId:this.caseLawSearch.caseCaseTypeId,//案件类型
                    caseSettleStatus:this.caseLawSearch.caseSettleStatus,//结案状态
                    sortMode:this.caseLawSearch.sortMode,//排序方法
                    pageNum:this.pageNum,
                    pageSize:this.pageSize
                };
                addCaseService.querySenior(this.$http,params).then(msg=>{
                    this.caseData=msg.data.data.list;
                    this.total=msg.data.data.total;
                    this.pageSize=msg.data.data.pageSize;
                    this.$loading().close()
                })
            },
            cellStyle(column){//单元格样式
                if (column.columnIndex===9||column.columnIndex===10){
                    return "color:red;font-size:20px"
                }
            },
            caseContractFilenumberFormatter(row, column, cellValue){//合同，档案
                if(cellValue==="2"){
                    return "✔"
                }else{
                    return "✘"
                }
            },
            // systemApprovalIdFormatter(row, column, cellValue){//审批人
            //     if(cellValue==null){
            //         return "-"
            //     }
            // },
            caseSettleStatusFormatter(row, column, cellValue){//结案状态
                if(cellValue==="N"){
                    return "未结案"
                }else{
                    return "已结案"
                }
            },
            caseApproveStatusFormatter(row, column, cellValue){//审批状态
                if(cellValue==="1"){
                    return "审批中"
                }else if(cellValue==="2"){
                    return "审批通过"
                }else{
                    return "审批不通过"
                }
            },
            queryCaseType(){//查询案件类型
                addCaseService.queryCct(this.$http).then(msg=>{
                    this.caseTypeData=msg.data.data.data
                })
            },
            queryCase(param){//查询个人案件
                this.$loading({//懒加载
                    lock: true,
                    text: '正在查询...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                const params={
                    searchData:this.caseLawSearch.searchData,//搜索框数据
                    select:this.caseLawSearch.select,//下拉框选项
                    caseApproveStatus:this.caseLawSearch.caseApproveStatus,//审批状态
                    caseCaseTypeId:this.caseLawSearch.caseCaseTypeId,//案件类型
                    caseSettleStatus:this.caseLawSearch.caseSettleStatus,//结案状态
                    sortMode:this.caseLawSearch.sortMode,//排序方法
                    hrEmpId:JSON.parse(localStorage["user"])[0].hrEmpId,
                    lawyerNum:"1",
                    pageNum:param==null?this.pageNum:(param.pageNum===undefined?this.pageNum:param.pageNum),
                    pageSize:param==null?this.pageSize:(param.pageSize===undefined?this.pageSize:param.pageSize)
                };
                addCaseService.querySenior(this.$http,params).then(msg=>{
                    this.caseData=msg.data.data.list;
                    this.total=msg.data.data.total;
                    this.pageSize=msg.data.data.pageSize;
                    this.$loading().close()
                })
            },
            queryCases(param){//查询合办案件
                this.$loading({//懒加载
                    lock: true,
                    text: '正在查询...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                const btns=$(".role_btn");
                for (let i = 0; i <btns.length ; i++) {
                    $(btns[i]).removeAttr('disabled');
                }
                const params={
                    searchData:this.caseLawSearch.searchData,//搜索框数据
                    select:this.caseLawSearch.select,//下拉框选项
                    caseApproveStatus:this.caseLawSearch.caseApproveStatus,//审批状态
                    caseCaseTypeId:this.caseLawSearch.caseCaseTypeId,//案件类型
                    caseSettleStatus:this.caseLawSearch.caseSettleStatus,//结案状态
                    sortMode:this.caseLawSearch.sortMode,//排序方法
                    lawyerNum:"2",
                    caseAttorney:JSON.parse(localStorage["user"])[0].userRealname,
                    pageNum:param==null?this.pageNum:(param.pageNum===undefined?this.pageNum:param.pageNum),
                    pageSize:param==null?this.pageSize:(param.pageSize===undefined?this.pageSize:param.pageSize)
                };
                addCaseService.querySenior(this.$http,params).then(msg=>{
                    this.caseData=msg.data.data.list;
                    this.total=msg.data.data.total;
                    this.pageSize=msg.data.data.pageSize;
                    this.$loading().close();
                    setTimeout(()=>{
                        const btns=$(".role_btn");
                        for (let i = 0; i <btns.length ; i++) {
                            if(parseInt(btns[i].id)!==parseInt(JSON.parse(localStorage["user"])[0].hrEmpId)){
                                $(btns[i]).prop('disabled','disabled');
                            }
                        }
                    },100)
                })
            },
            queryShareCase(param){//查询共享案件
                this.$loading({//懒加载
                    lock: true,
                    text: '正在查询...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                const btns=$(".share_btn");
                for (let i = 0; i <btns.length ; i++) {
                    $(btns[i]).removeAttr('disabled');
                }
                const params={
                    searchData:this.caseLawSearch.searchData,//搜索框数据
                    select:this.caseLawSearch.select,//下拉框选项
                    caseApproveStatus:this.caseLawSearch.caseApproveStatus,//审批状态
                    caseCaseTypeId:this.caseLawSearch.caseCaseTypeId,//案件类型
                    caseSettleStatus:this.caseLawSearch.caseSettleStatus,//结案状态
                    sortMode:this.caseLawSearch.sortMode,//排序方法
                    caseShare:"1",
                    pageNum:param==null?this.pageNum:(param.pageNum===undefined?this.pageNum:param.pageNum),
                    pageSize:param==null?this.pageSize:(param.pageSize===undefined?this.pageSize:param.pageSize)
                };
                addCaseService.querySenior(this.$http,params).then(msg=>{
                    this.caseData=msg.data.data.list;
                    this.total=msg.data.data.total;
                    this.pageSize=msg.data.data.pageSize;
                    this.$loading().close();
                    setTimeout(()=>{
                        const btns=$(".share_btn");
                        for (let i = 0; i <btns.length ; i++) {
                            if(parseInt(btns[i].id)!==parseInt(JSON.parse(localStorage["user"])[0].hrEmpId)){
                                $(btns[i]).prop('disabled','disabled');
                            }
                        }
                    },100)
                })
            },
            queryPayCase(param){//查询付款案件
                this.$loading({//懒加载
                    lock: true,
                    text: '正在查询...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                const params={
                    searchData:this.caseLawSearch.searchData,//搜索框数据
                    select:this.caseLawSearch.select,//下拉框选项
                    caseApproveStatus:this.caseLawSearch.caseApproveStatus,//审批状态
                    caseCaseTypeId:this.caseLawSearch.caseCaseTypeId,//案件类型
                    caseSettleStatus:this.caseLawSearch.caseSettleStatus,//结案状态
                    sortMode:this.caseLawSearch.sortMode,//排序方法
                    hrEmpId:JSON.parse(localStorage["user"])[0].hrEmpId,
                    caseUnpaidsal:1,
                    pageNum:param==null?this.pageNum:(param.pageNum===undefined?this.pageNum:param.pageNum),
                    pageSize:param==null?this.pageSize:(param.pageSize===undefined?this.pageSize:param.pageSize)
                };
                addCaseService.querySenior(this.$http,params).then(msg=> {
                    this.caseData = msg.data.data.list;
                    this.total=msg.data.data.total;
                    this.pageSize=msg.data.data.pageSize;
                    this.$loading().close();
                })
            },
            querySummaryCases(param){//查询汇总案件
                this.$loading({//懒加载
                    lock: true,
                    text: '正在查询...',
                    spinner: 'fa fa-refresh fa-spin fa-3x',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                const btns=$(".summary_btn");
                for (let i = 0; i <btns.length ; i++) {
                    $(btns[i]).removeAttr('disabled');
                }
                const params={
                    searchData:this.caseLawSearch.searchData,//搜索框数据
                    select:this.caseLawSearch.select,//下拉框选项
                    caseApproveStatus:this.caseLawSearch.caseApproveStatus,//审批状态
                    caseCaseTypeId:this.caseLawSearch.caseCaseTypeId,//案件类型
                    caseSettleStatus:this.caseLawSearch.caseSettleStatus,//结案状态
                    sortMode:this.caseLawSearch.sortMode,//排序方法
                    caseAttorney:JSON.parse(localStorage["user"])[0].userRealname,
                    pageNum:param==null?this.pageNum:(param.pageNum===undefined?this.pageNum:param.pageNum),
                    pageSize:param==null?this.pageSize:(param.pageSize===undefined?this.pageSize:param.pageSize)
                };
                addCaseService.querySenior(this.$http,params).then(msg=>{
                    this.caseData=msg.data.data.list;
                    this.total=msg.data.data.total;
                    this.pageSize=msg.data.data.pageSize;
                    this.$loading().close();
                    setTimeout(()=>{
                        const btns=$(".summary_btn");
                        for (let i = 0; i <btns.length ; i++) {
                            if(parseInt(btns[i].id)!==parseInt(JSON.parse(localStorage["user"])[0].hrEmpId)){
                                $(btns[i]).prop('disabled','disabled');
                            }
                        }
                    },100)
                })
            },
        }
    }
</script>

<style scoped>
    a{
        text-decoration: none;
    }
    a:link{
        color: blue;
    }
    a:visited{
        color: blue;
    }
    a:hover{
        color: red;
        text-decoration: underline;
    }
    button[disabled]{
        background-color: #a0cfff;
        border-color: #a0cfff;
        cursor: not-allowed;
    }
</style>